package com.gxjc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.gxjc.dao.bean.NatureDao;
import com.gxjc.model.Nature;
@Transactional
public class NatureService {
	@Autowired
	NatureDao natureDao;
	public List<Nature> getAll(){
		return natureDao.getAll();	
	}
	
	public void save(Nature nature) {
		natureDao.save(nature);
	}
	
	public void delete(int id) {
		natureDao.delete(id);
	}
	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public Nature getNatureById(int id) {
		return (Nature)natureDao.getNatureById(id);
	}
	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public List<Nature> getNatureBySql(String sql) {
		return natureDao.getNatureBySql(sql);
	}
	public void update(Nature nature) {
		natureDao.update(nature);
	}
	//get and set

	public NatureDao getNatureDao() {
		return natureDao;
	}

	public void setNatureDao(NatureDao natureDao) {
		this.natureDao = natureDao;
	}
	
	
}
